﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Cherry.Agile.RpcService
{
    /// <summary>
    /// 服务插件属性类(用于配置加载)
    /// </summary>
    [AttributeUsage(AttributeTargets.Class)]
    public class ServiceProcessorAttribute : Attribute
    {
        public ServiceProcessorAttribute()
        {
        }

        public ServiceProcessorAttribute(int businessCode, int functionCode)
        {
            BusinessCode = businessCode;
            FunctionCode = functionCode;
        }

        public ServiceProcessorAttribute(int businessCode, int functionCode, bool requireValidate, string description)
        {
            BusinessCode = businessCode;
            FunctionCode = functionCode;
            RequireValidate = requireValidate;
            Description = description;
        }

        /// <summary>
        /// 业务类别码
        /// </summary>
        public int BusinessCode { get; set; }
        /// <summary>
        /// 功能码
        /// </summary>
        public int FunctionCode { get; set; }
        /// <summary>
        /// 需要验证
        /// </summary>
        public bool RequireValidate { get; set; }
        /// <summary>
        /// 说明
        /// </summary>
        public string Description { get; set; }

        /// <summary>
        /// 过期不用的接口
        /// </summary>
        public bool Disabled { get; set; }
    }
}
